#include <iostream>
#include <cstdio>
#include <vector> 
#include <algorithm>

using namespace std; 

struct player_t {
	int id; 
	int sc; 		// score
	int w; 
}; 

bool cmp_w(player_t &a, player_t &b) 
{
	return a.sc==b.sc ? (a.id<b.id) : (a.sc>b.sc); 
}

void dump_players(string msg, vector <player_t>a)
{
	cout<<msg<<", size="<<a.size()<<endl; 
	for (unsigned i=0; i<a.size(); i++) {
		cout<<"id="<<a[i].id<<",sc="<<a[i].sc<<endl; 
	}
	cout<<endl; 
}

void merge_sort(vector<player_t> &a, vector<player_t> &x, vector<player_t> &y)
{
	unsigned i=0, j=0; 
	while(i<x.size() || j<y.size()) {
		if (i==x.size()) {
			a.push_back(y[j]); 
			j++; 
		} else if (j==y.size()) {
			a.push_back(x[i]); 
			i++; 
		} else {
			if (cmp_w(x[i],y[j])) {
				a.push_back(x[i]); 
				i++; 
			} else {
				a.push_back(y[j]); 
				j++;
			} 
		}
	}
}

int main()
{
	int i, j, n, r, q; 
	player_t p; 
	vector <player_t>a, x, y; 

	//freopen("p1309_1.in", "r", stdin); 
	
	cin>>n>>r>>q; 
	for (i=0; i<2*n; i++) {
		p.id = i+1; 
		cin>>p.sc; 
		a.push_back(p); 
	}
	for (i=0; i<2*n; i++) {
		cin>>a[i].w; 
	}
	sort(a.begin(), a.end(), cmp_w); 
	for (j=0; j<r; j++) {
		//dump_players("a", a); 
		for (i=0; i<2*n; i+=2) {
			if (a[i].w>a[i+1].w) {
				a[i].sc += 1; 
				x.push_back(a[i]); 
				y.push_back(a[i+1]); 
			} else {
				a[i+1].sc += 1; 
				x.push_back(a[i+1]); 
				y.push_back(a[i]); 
			}
			//cout<<"x.size = "<<x.size()<<endl; 
			//cout<<"y.size = "<<y.size()<<endl; 
		}

		//dump_players("x", x); 
		//dump_players("y", x); 

		a.clear(); 
		merge_sort(a, x, y); 
		x.clear();
		y.clear(); 
	}
	cout<<a[q-1].id<<"\n"; 
	return 0; 
}



